<?php
class Follow extends CI_Controller {
	
	public function __construct() {
		parent::__construct ();
		$this->load->model('follow_model');
	}
	
	public function index(){
		$uid = $this->session->userdata('user_id');
		$bid = $this->input->post('bid');
		if ($uid&&$bid){
			echo $this->follow_model->follow($uid,$bid);
		} else {
			echo -1;
		}
	}
	
	public function remove(){
		$uid = $this->session->userdata('user_id');
		$bid = $this->input->post('bid');
		echo $this->follow_model->unfollow($uid,$bid);
	}
	
}

?>